<template>
	<view class="u-demo">
		<view class="u-demo-title">
			{{content.name}}
		</view>
		<image :src="base+content.imgUrl" mode="" style="width: 100%;"></image>
		<view class="">
			项目类型:{{content.type.name}}
		</view>
		<view class="">
			筹款目标:{{content.moneyTotal}}元
		</view>
		<view class="">
			捐款进度:{{(content.moneyNow/content.moneyTotal).toFixed(4)}}
		</view>
		<view class="">
			公益内容：{{content.description == ''?'没有内容':content.description}}
		</view>
		<view class="">
			项目时间：{{content.activityAt}}
		</view>
		<view>发布人:{{content.author}}</view>
		<view>参捐人数:{{content.donateCount}}</view>
		<view>项目备案号:null</view>
		<view>已筹善款:{{content.moneyNow}}元</view>
		<uni-group title="捐助记录" style="position: absolute;z-index: 99;right: 0%;top: 40%;">
			<scroll-view :scroll-y="true" style="height: 200rpx;">
				<uni-list>
					<uni-list-item v-for="(item,index) in list" :title="item.userName" :note="item.donateMoney+'元'">
					</uni-list-item>
				</uni-list>
			</scroll-view>
		</uni-group>
		<uni-card title="捐款去向">
			<view class="">
				{{content.detailsList == null?'暂时没有数据':content.detailsList}}
			</view>
		</uni-card>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base: api.baseurl,
				content: '',
				list: []
			}
		},
		onLoad(options) {
			this.getlun(options.id)
		},
		methods: {
			getlun(name) {
				this.$get(this.base + '/prod-api/api/public-welfare/public-welfare-activity/list', {
					name: name
				}).then((res) => {
					this.content = res.rows[0]
					this.$get(this.base + '/prod-api/api/public-welfare/donate-record/list', {
						activityId: res.rows[0].id
					}).then((res) => {
						this.list = res.rows
					})
					console.log(res)
				})
			},
		}
	}
</script>

<style>

</style>
